package com.fary.expression.spel.standard;

import com.fary.core.SpringException;
import com.fary.expression.ParserContext;
import com.fary.expression.common.TemplateAwareExpressionParser;
import com.fary.expression.spel.SpelParserConfiguration;
import com.fary.util.Assert;

public class SpelExpressionParser extends TemplateAwareExpressionParser {

	private final SpelParserConfiguration configuration;


	/**
	 * Create a parser with default settings.
	 */
	public SpelExpressionParser() {
		this.configuration = new SpelParserConfiguration();
	}

	/**
	 * Create a parser with the specified configuration.
	 * @param configuration custom configuration options
	 */
	public SpelExpressionParser(SpelParserConfiguration configuration) {
		Assert.notNull(configuration, "SpelParserConfiguration must not be null");
		this.configuration = configuration;
	}


	public SpelExpression parseRaw(String expressionString) throws SpringException {
		return doParseExpression(expressionString, null);
	}

	@Override
	protected SpelExpression doParseExpression(String expressionString, ParserContext context) throws SpringException {
//		return new InternalSpelExpressionParser(this.configuration).doParseExpression(expressionString, context);
		return null;
	}

}